package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

public class CollectionDemo1 {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        //Collection c = new HashSet();
        boolean flag = c.add("one");
        System.out.println(flag);
        c.add("a");
        c.add("b");
        c.add("c");
        c.add("d");
        c.add("e");
        c.add("a");
        flag = c.add("one");
        System.out.println(flag);
        System.out.println(c);

        int size = c.size();
        System.out.println("size：" + size);

        boolean isEmpty = c.isEmpty();
        System.out.println("空集：" + isEmpty);

        c.clear();
        System.out.println(c);
        System.out.println(c.size());
        System.out.println(c.isEmpty());


    }
}
